import request from '@/utils/request'

const prefix = 'case'



export function getAllCases() {
  return request({
    url: `${prefix}`,
    method: 'get'
  })
}

export function createCase(data) {
  return request({
    url: `${prefix}`,
    method: 'Post',
    data
  })
}

/**
 * 某一任务我所拥有的全部权限
 * @param params
 */
export function getDetail(params) {
  return request({
    url: `${prefix}/case`,
    method: 'get',
    params,
  })
}

/**
 * 处理申请权限
 * 可以是「授予」，也可以是「拒绝」
 */
export function passCases(data) {
  return request({
    url: `${prefix}/pass`,
    method: 'post',
    data,
  })
}

export function unpassCases(data) {
  return request({
    url: `${prefix}/unpass`,
    method: 'post',
    data,
  })
}
export function getUnreviewedCase() {
  return request({
    url: `${prefix}/unreviewed`,
    method: 'get'
  })
}
export function insertComment(data) {
  return request({
    url: `${prefix}/insertComment`,
    method: 'post',
    data
  })
}


